#include<unistd.h>
#include<linux/reboot.h>
#include "../err.h"
/*
 * according to the manual page:This system call will fail(with EINVAL) unless
 * 'magic' equals LINUX_REBOOT_MAGIC1(that is, 0xfee1dead) and 'magic2' equals LINUX_REBOOT_MAGIC2
 * (that is, 672274793)
 *
 * as the following code block, it won't work...
 */
int main(int argc,char *agrv[])
{
	void *arg="system reboot now";
	sync();
	//reboot(LINUX_REBOOT_MAGIC1,LINUX_REBOOT_MAGIC2,LINUX_REBOOT_CMD_RESTART,arg);
	reboot(0xfee1dead,672274793,LINUX_REBOOT_CMD_RESTART,arg);
	if(errno)
		err("reboot");
}
